<template>
  <el-config-provider :locale="currentLocale">
    <router-view v-slot="{ Component }">
      <!-- <transition name="blur" mode="out-in"> -->
        <component :is="Component" :key="reload.routerKeys" />
      <!-- </transition> -->
    </router-view>
    <ReDialog />
    <customPopover />
  </el-config-provider>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import { ElConfigProvider } from "element-plus";
import { ReDialog } from "@/components/ReDialog";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import customPopover from '@/components/customPopover/customPopover.vue'
import { usePageReloadStoreHook } from "@/store/modules/pageReload";

export default defineComponent({
  name: "app",
  components: {
    [ElConfigProvider.name]: ElConfigProvider,
    ReDialog,
    customPopover
  },
  computed: {
    currentLocale() {
      return zhCn;
    }
  },
  data() {
    return {
      reload: usePageReloadStoreHook()
    };
  },
});
</script>

<style lang="scss">
.blur-enter-active,
.blur-leave-active {
  --animation-time: 0.5s;
  overflow: hidden;
}

.blur-enter-active {
  animation: shadow var(--animation-time) reverse;

  &::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 999999;
    animation: shadow var(--animation-time) reverse;
  }
}

.blur-leave-active {
  animation: shadow var(--animation-time);

  &::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 999999;
    animation: shadow var(--animation-time);
  }
}

@keyframes shadow {
  0% {
    box-shadow: inset 0px 0px 0px 0px var(--el-color-primary);
    backdrop-filter: blur(0px);
  }

  100% {
    box-shadow: inset 0px 0px 200px 0 var(--el-color-primary);
    backdrop-filter: blur(10px);
  }
}
</style>
